.class final Lcom/ninesky/browser/view/bl;
.super Landroid/widget/BaseAdapter;


# instance fields
.field private a:[Lcom/ninesky/browser/provider/b;

.field private b:Landroid/os/AsyncTask;

.field private c:Landroid/content/Context;

.field private synthetic d:Lcom/ninesky/browser/view/j;


# direct methods
.method public constructor <init>(Lcom/ninesky/browser/view/j;Landroid/content/Context;)V
    .locals 0

    iput-object p1, p0, Lcom/ninesky/browser/view/bl;->d:Lcom/ninesky/browser/view/j;

    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    iput-object p2, p0, Lcom/ninesky/browser/view/bl;->c:Landroid/content/Context;

    return-void
.end method

.method static synthetic a(Lcom/ninesky/browser/view/bl;)Landroid/content/Context;
    .locals 1

    iget-object v0, p0, Lcom/ninesky/browser/view/bl;->c:Landroid/content/Context;

    return-object v0
.end method

.method static synthetic a(Lcom/ninesky/browser/view/bl;[Lcom/ninesky/browser/provider/b;)V
    .locals 0

    iput-object p1, p0, Lcom/ninesky/browser/view/bl;->a:[Lcom/ninesky/browser/provider/b;

    return-void
.end method


# virtual methods
.method public final a()V
    .locals 2

    iget-object v0, p0, Lcom/ninesky/browser/view/bl;->b:Landroid/os/AsyncTask;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/ninesky/browser/view/bl;->b:Landroid/os/AsyncTask;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Landroid/os/AsyncTask;->cancel(Z)Z

    :cond_0
    new-instance v0, Lcom/ninesky/browser/view/h;

    invoke-direct {v0, p0}, Lcom/ninesky/browser/view/h;-><init>(Lcom/ninesky/browser/view/bl;)V

    iput-object v0, p0, Lcom/ninesky/browser/view/bl;->b:Landroid/os/AsyncTask;

    iget-object v0, p0, Lcom/ninesky/browser/view/bl;->b:Landroid/os/AsyncTask;

    const/4 v1, 0x0

    new-array v1, v1, [Ljava/lang/Void;

    invoke-virtual {v0, v1}, Landroid/os/AsyncTask;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    return-void
.end method

.method public final getCount()I
    .locals 1

    iget-object v0, p0, Lcom/ninesky/browser/view/bl;->a:[Lcom/ninesky/browser/provider/b;

    if-nez v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return v0

    :cond_0
    iget-object v0, p0, Lcom/ninesky/browser/view/bl;->a:[Lcom/ninesky/browser/provider/b;

    array-length v0, v0

    goto :goto_0
.end method

.method public final getItem(I)Ljava/lang/Object;
    .locals 1

    iget-object v0, p0, Lcom/ninesky/browser/view/bl;->a:[Lcom/ninesky/browser/provider/b;

    if-nez v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return-object v0

    :cond_0
    iget-object v0, p0, Lcom/ninesky/browser/view/bl;->a:[Lcom/ninesky/browser/provider/b;

    aget-object v0, v0, p1

    goto :goto_0
.end method

.method public final getItemId(I)J
    .locals 2

    const-wide/16 v0, 0x0

    return-wide v0
.end method

.method public final getItemViewType(I)I
    .locals 2

    const/4 v0, 0x2

    iget-object v1, p0, Lcom/ninesky/browser/view/bl;->a:[Lcom/ninesky/browser/provider/b;

    if-eqz v1, :cond_0

    iget-object v1, p0, Lcom/ninesky/browser/view/bl;->a:[Lcom/ninesky/browser/provider/b;

    aget-object v1, v1, p1

    if-eqz v1, :cond_0

    iget-object v0, p0, Lcom/ninesky/browser/view/bl;->a:[Lcom/ninesky/browser/provider/b;

    aget-object v0, v0, p1

    iget-object v0, v0, Lcom/ninesky/browser/provider/b;->c:Landroid/graphics/Bitmap;

    if-eqz v0, :cond_1

    const/4 v0, 0x1

    :cond_0
    :goto_0
    return v0

    :cond_1
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public final getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 11

    invoke-virtual {p0, p1}, Lcom/ninesky/browser/view/bl;->getItemViewType(I)I

    move-result v0

    if-nez p2, :cond_c

    const/4 v1, 0x1

    if-ne v0, v1, :cond_2

    iget-object v1, p0, Lcom/ninesky/browser/view/bl;->d:Lcom/ninesky/browser/view/j;

    invoke-static {v1}, Lcom/ninesky/browser/view/j;->a(Lcom/ninesky/browser/view/j;)Landroid/view/LayoutInflater;

    move-result-object v1

    const v2, 0x7f03000c

    const/4 v3, 0x0

    invoke-virtual {v1, v2, v3}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v1

    :goto_0
    const/4 v2, 0x1

    if-ne v0, v2, :cond_0

    iget-object v2, p0, Lcom/ninesky/browser/view/bl;->a:[Lcom/ninesky/browser/provider/b;

    aget-object v2, v2, p1

    const v3, 0x7f0c001f

    invoke-virtual {v1, v3}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object p2

    check-cast p2, Landroid/widget/TextView;

    const v3, 0x7f0c001e

    invoke-virtual {v1, v3}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object p3

    check-cast p3, Landroid/widget/ImageView;

    iget-object v3, v2, Lcom/ninesky/browser/provider/b;->c:Landroid/graphics/Bitmap;

    if-nez v3, :cond_4

    const/4 v3, 0x0

    invoke-virtual {p3, v3}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    :goto_1
    iget-object v3, v2, Lcom/ninesky/browser/provider/b;->a:Ljava/lang/String;

    if-eqz v3, :cond_a

    const-string v3, ""

    iget-object v4, v2, Lcom/ninesky/browser/provider/b;->a:Ljava/lang/String;

    invoke-virtual {v4}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_a

    iget-object v3, v2, Lcom/ninesky/browser/provider/b;->a:Ljava/lang/String;

    :goto_2
    invoke-virtual {p2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    const/4 v3, 0x4

    new-array v3, v3, [Ljava/lang/Object;

    const/4 v4, 0x0

    iget-object v5, v2, Lcom/ninesky/browser/provider/b;->b:Ljava/lang/String;

    aput-object v5, v3, v4

    const/4 v4, 0x1

    iget-object v5, v2, Lcom/ninesky/browser/provider/b;->a:Ljava/lang/String;

    aput-object v5, v3, v4

    const/4 v4, 0x2

    iget v5, v2, Lcom/ninesky/browser/provider/b;->f:I

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v5

    aput-object v5, v3, v4

    const/4 v4, 0x3

    iget-object v2, v2, Lcom/ninesky/browser/provider/b;->e:Ljava/lang/String;

    aput-object v2, v3, v4

    invoke-virtual {v1, v3}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    :cond_0
    if-nez v0, :cond_1

    iget-object v0, p0, Lcom/ninesky/browser/view/bl;->a:[Lcom/ninesky/browser/provider/b;

    aget-object v0, v0, p1

    const v2, 0x7f0c0019

    invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object p0

    check-cast p0, Landroid/widget/TextView;

    iget-object v2, v0, Lcom/ninesky/browser/provider/b;->a:Ljava/lang/String;

    if-eqz v2, :cond_b

    const-string v2, ""

    iget-object v3, v0, Lcom/ninesky/browser/provider/b;->a:Ljava/lang/String;

    invoke-virtual {v3}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-nez v2, :cond_b

    iget-object v2, v0, Lcom/ninesky/browser/provider/b;->a:Ljava/lang/String;

    :goto_3
    invoke-virtual {p0, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    const/4 v2, 0x4

    new-array v2, v2, [Ljava/lang/Object;

    const/4 v3, 0x0

    iget-object v4, v0, Lcom/ninesky/browser/provider/b;->b:Ljava/lang/String;

    aput-object v4, v2, v3

    const/4 v3, 0x1

    iget-object v4, v0, Lcom/ninesky/browser/provider/b;->a:Ljava/lang/String;

    aput-object v4, v2, v3

    const/4 v3, 0x2

    iget v4, v0, Lcom/ninesky/browser/provider/b;->f:I

    invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    aput-object v4, v2, v3

    const/4 v3, 0x3

    iget-object v0, v0, Lcom/ninesky/browser/provider/b;->e:Ljava/lang/String;

    aput-object v0, v2, v3

    invoke-virtual {v1, v2}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    :cond_1
    return-object v1

    :cond_2
    if-nez v0, :cond_3

    iget-object v1, p0, Lcom/ninesky/browser/view/bl;->d:Lcom/ninesky/browser/view/j;

    invoke-static {v1}, Lcom/ninesky/browser/view/j;->a(Lcom/ninesky/browser/view/j;)Landroid/view/LayoutInflater;

    move-result-object v1

    const v2, 0x7f03000a

    const/4 v3, 0x0

    invoke-virtual {v1, v2, v3}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v1

    goto/16 :goto_0

    :cond_3
    iget-object v1, p0, Lcom/ninesky/browser/view/bl;->d:Lcom/ninesky/browser/view/j;

    invoke-static {v1}, Lcom/ninesky/browser/view/j;->a(Lcom/ninesky/browser/view/j;)Landroid/view/LayoutInflater;

    move-result-object v1

    const v2, 0x7f030009

    const/4 v3, 0x0

    invoke-virtual {v1, v2, v3}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v1

    goto/16 :goto_0

    :cond_4
    invoke-static {}, Lcom/ninesky/browser/ed;->a()I

    move-result v4

    invoke-static {}, Lcom/ninesky/browser/ed;->b()I

    move-result v5

    if-eqz v3, :cond_5

    if-lez v4, :cond_5

    if-gtz v5, :cond_7

    :cond_5
    const/4 v3, 0x0

    :cond_6
    :goto_4
    invoke-virtual {p3, v3}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    goto/16 :goto_1

    :cond_7
    invoke-virtual {v3}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v6

    invoke-virtual {v3}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v7

    if-gt v6, v4, :cond_8

    if-le v7, v5, :cond_6

    :cond_8
    const-string v8, "ImageUtil"

    new-instance v9, Ljava/lang/StringBuilder;

    const-string v10, "w1:"

    invoke-direct {v9, v10}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v9, v6}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v9

    const-string v10, " h1:"

    invoke-virtual {v9, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v9

    invoke-virtual {v9, v7}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v9

    const-string v10, " w:"

    invoke-virtual {v9, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v9

    invoke-virtual {v9, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v9

    const-string v10, " h:"

    invoke-virtual {v9, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v9

    invoke-virtual {v9, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v9

    invoke-virtual {v9}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v9

    invoke-static {v8, v9}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    if-le v6, v4, :cond_9

    mul-int/2addr v7, v4

    div-int v6, v7, v6

    const/4 v7, 0x0

    invoke-static {v3, v4, v6, v7}, Landroid/graphics/Bitmap;->createScaledBitmap(Landroid/graphics/Bitmap;IIZ)Landroid/graphics/Bitmap;

    move-result-object v3

    :cond_9
    invoke-virtual {v3}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v4

    invoke-virtual {v3}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v6

    if-le v6, v5, :cond_6

    const/4 v6, 0x0

    const/4 v7, 0x0

    invoke-static {v3, v6, v7, v4, v5}, Landroid/graphics/Bitmap;->createBitmap(Landroid/graphics/Bitmap;IIII)Landroid/graphics/Bitmap;

    move-result-object v3

    goto :goto_4

    :cond_a
    iget-object v3, v2, Lcom/ninesky/browser/provider/b;->b:Ljava/lang/String;

    goto/16 :goto_2

    :cond_b
    iget-object v2, v0, Lcom/ninesky/browser/provider/b;->b:Ljava/lang/String;

    goto/16 :goto_3

    :cond_c
    move-object v1, p2

    goto/16 :goto_0
.end method

.method public final getViewTypeCount()I
    .locals 1

    const/4 v0, 0x3

    return v0
.end method
